package com.ruoyi.file.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.file.mapper.FileDictDataMapper;
import com.ruoyi.file.domain.FileDictData;
import com.ruoyi.file.service.IFileDictDataService;

/**
 * 字典数据Service业务层处理
 * 
 * @author rww
 * @date 2023-02-20
 */
@Service
public class FileDictDataServiceImpl implements IFileDictDataService 
{
    @Autowired
    private FileDictDataMapper fileDictDataMapper;

    /**
     * 查询字典数据
     * 
     * @param dictCode 字典数据主键
     * @return 字典数据
     */
    @Override
    public FileDictData selectFileDictDataByDictCode(Long dictCode)
    {
        return fileDictDataMapper.selectFileDictDataByDictCode(dictCode);
    }

    /**
     * 查询字典数据列表
     * 
     * @param fileDictData 字典数据
     * @return 字典数据
     */
    @Override
    public List<FileDictData> selectFileDictDataList(FileDictData fileDictData)
    {
        return fileDictDataMapper.selectFileDictDataList(fileDictData);
    }

    /**
     * 新增字典数据
     * 
     * @param fileDictData 字典数据
     * @return 结果
     */
    @Override
    public int insertFileDictData(FileDictData fileDictData)
    {
        fileDictData.setCreateTime(DateUtils.getNowDate());
        return fileDictDataMapper.insertFileDictData(fileDictData);
    }

    /**
     * 修改字典数据
     * 
     * @param fileDictData 字典数据
     * @return 结果
     */
    @Override
    public int updateFileDictData(FileDictData fileDictData)
    {
        fileDictData.setUpdateTime(DateUtils.getNowDate());
        return fileDictDataMapper.updateFileDictData(fileDictData);
    }

    /**
     * 批量删除字典数据
     * 
     * @param dictCodes 需要删除的字典数据主键
     * @return 结果
     */
    @Override
    public int deleteFileDictDataByDictCodes(Long[] dictCodes)
    {
        return fileDictDataMapper.deleteFileDictDataByDictCodes(dictCodes);
    }

    /**
     * 删除字典数据信息
     * 
     * @param dictCode 字典数据主键
     * @return 结果
     */
    @Override
    public int deleteFileDictDataByDictCode(Long dictCode)
    {
        return fileDictDataMapper.deleteFileDictDataByDictCode(dictCode);
    }
}
